package com.whsm.boot;

import com.whsm.boot.bean.Pet;
import com.whsm.boot.bean.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication(scanBasePackages = "com.whsm.boot")
public class FirstSpringboot {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(FirstSpringboot.class, args);
//        String[] names = run.getBeanDefinitionNames();
//        for (String name : names) {
//            System.out.println(name);
//        }
//        Pet pet = run.getBean("pet", Pet.class);
//        Pet pet1 = run.getBean("pet", Pet.class);
//        System.out.println(pet==pet1);
//        Pet pet = run.getBean("pet", Pet.class);
//        User user = run.getBean("user", User.class);
//        System.out.println(pet==user.getPet());
//        String[] names = run.getBeanDefinitionNames();
//        for (String name : names) {
//            System.out.println(name);
//        }
//        boolean haha = run.containsBean("haha");
//        boolean hehe = run.containsBean("hehe");
//        System.out.println(haha);
//        System.out.println(hehe);


    }
}
